package com.opesoft.calendar.model;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import org.hibernate.annotations.ForeignKey;

@Entity
@Table(name="noteconfig")
public class NoteConfig implements Serializable
{
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE, generator="NoteConfigIdGenerator")
	@TableGenerator(name="NoteConfigIdGenerator", table="ids", pkColumnName="entity", valueColumnName="maxid", pkColumnValue="NoteConfig", allocationSize=1)
	long id;

	@Basic
	@Column(name="noteType")
	Long noteTypeId;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="noteType", insertable=false, updatable=false)
	@ForeignKey(name="fk_noteconfig_1")
	NoteType noteType;

	@Basic
	String name;

	@Basic
	String value;

	public long getId()
	{
		return id;
	}

	public void setId(long id)
	{
		this.id=id;
	}

	public Long getNoteTypeId()
	{
		return noteTypeId;
	}

	public void setNoteTypeId(Long noteTypeId)
	{
		this.noteTypeId=noteTypeId;
	}

	public NoteType getNoteType()
	{
		return noteType;
	}

	public void setNoteType(NoteType noteType)
	{
		this.noteType=noteType;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name=name;
	}

	public String getValue()
	{
		return value;
	}

	public void setValue(String value)
	{
		this.value=value;
	}
}
